|
charger30 2.2.0
|
API for configuring and manipulating Charger 30 Click driver. More...
Topics | |
| Charger 30 Registers List | |
| List of registers of Charger 30 Click driver. | |
| Charger 30 Registers Settings | |
| Settings for registers of Charger 30 Click driver. | |
| Charger 30 MikroBUS Map | |
| MikroBUS pin mapping of Charger 30 Click driver. | |
Functions | |
| void | charger30_cfg_setup (charger30_cfg_t *cfg) |
| Charger 30 configuration object setup function. | |
| err_t | charger30_init (charger30_t *ctx, charger30_cfg_t *cfg) |
| Charger 30 initialization function. | |
| err_t | charger30_default_cfg (charger30_t *ctx) |
| Charger 30 default configuration function. | |
| err_t | charger30_write_reg (charger30_t *ctx, uint8_t reg, uint8_t data_in) |
| Charger 30 write register function. | |
| err_t | charger30_write_regs (charger30_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| Charger 30 write registers function. | |
| err_t | charger30_read_reg (charger30_t *ctx, uint8_t reg, uint8_t *data_out) |
| Charger 30 read register function. | |
| err_t | charger30_read_regs (charger30_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| Charger 30 read registers function. | |
| void | charger30_enable_boost (charger30_t *ctx) |
| Charger 30 enable boost function. | |
| void | charger30_disable_boost (charger30_t *ctx) |
| Charger 30 disable boost function. | |
| void | charger30_enable_charging (charger30_t *ctx) |
| Charger 30 enable charging function. | |
| void | charger30_disable_charging (charger30_t *ctx) |
| Charger 30 disable charging function. | |
| uint8_t | charger30_get_int_pin (charger30_t *ctx) |
| Charger 30 get INT pin function. | |
| err_t | charger30_check_communication (charger30_t *ctx) |
| Charger 30 check communication function. | |
| err_t | charger30_sw_reset (charger30_t *ctx) |
| Charger 30 software reset function. | |
| err_t | charger30_read_status (charger30_t *ctx, charger30_status_t *status) |
| Charger 30 read status function. | |
API for configuring and manipulating Charger 30 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void charger30_cfg_setup | ( | charger30_cfg_t * | cfg | ) |
Charger 30 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See charger30_cfg_t object definition for detailed explanation. |
| err_t charger30_check_communication | ( | charger30_t * | ctx | ) |
Charger 30 check communication function.
This function checks device communication by reading the part number register and comparing it with expected value.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t charger30_default_cfg | ( | charger30_t * | ctx | ) |
Charger 30 default configuration function.
This function executes a default configuration of Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void charger30_disable_boost | ( | charger30_t * | ctx | ) |
Charger 30 disable boost function.
This function disables boost mode by setting the OTG pin to LOW on the Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| void charger30_disable_charging | ( | charger30_t * | ctx | ) |
Charger 30 disable charging function.
This function disables battery charging by setting the CE pin to HIGH on the Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| void charger30_enable_boost | ( | charger30_t * | ctx | ) |
Charger 30 enable boost function.
This function enables boost mode by setting the OTG pin to HIGH on the Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| void charger30_enable_charging | ( | charger30_t * | ctx | ) |
Charger 30 enable charging function.
This function enables battery charging by setting the CE pin to LOW on the Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| uint8_t charger30_get_int_pin | ( | charger30_t * | ctx | ) |
Charger 30 get INT pin function.
This function reads the logic state of the INT pin.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| err_t charger30_init | ( | charger30_t * | ctx, |
| charger30_cfg_t * | cfg ) |
Charger 30 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See charger30_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t charger30_read_reg | ( | charger30_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
Charger 30 read register function.
This function reads a single byte of data from the selected register of the Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to the memory location to store the read data. |
0 - Success, -1 - Error. | err_t charger30_read_regs | ( | charger30_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
Charger 30 read registers function.
This function reads a sequence of bytes starting from the selected register of the Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [out] | data_out | : Pointer to the data buffer to store read bytes. |
| [in] | len | : Number of bytes to read. |
0 - Success, -1 - Error. | err_t charger30_read_status | ( | charger30_t * | ctx, |
| charger30_status_t * | status ) |
Charger 30 read status function.
This function reads multiple status and monitoring registers and stores the values into the provided status structure.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| [out] | status | : Pointer to the structure to store the device status information. See charger30_status_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t charger30_sw_reset | ( | charger30_t * | ctx | ) |
Charger 30 software reset function.
This function performs a software reset of the Charger 30 Click board by writing to the reset bit in the input voltage regulation register.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t charger30_write_reg | ( | charger30_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
Charger 30 write register function.
This function writes a single byte of data to the selected register of the Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data byte to be written. |
0 - Success, -1 - Error. | err_t charger30_write_regs | ( | charger30_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
Charger 30 write registers function.
This function writes a sequence of bytes starting from the selected register of the Charger 30 Click board.
| [in] | ctx | : Click context object. See charger30_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [in] | data_in | : Pointer to the data buffer to be written. |
| [in] | len | : Number of bytes to write. |
0 - Success, -1 - Error.